package com.wang.studentmanager;

import java.util.ArrayList;
import java.util.Scanner;

public class StudentManager {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Student> arrayList = new ArrayList<>();
        arrayList.add(new Student("17036043",25,"王配全","342401199902158973"));
        arrayList.add(new Student("17036045",27,"王二麻","342401200002158222"));
        do {
            Method.start();
            System.out.println("请选择您的操作：");
            int choice = sc.nextInt();
            switch (choice){
                case 1 ->{
                    Method.showInfo(arrayList);
                }
                case 2 ->{
                    Method.add(arrayList,sc);
                }
                case 3 ->{
                    Method.delete(arrayList,sc);
                }
                case 4 ->{
                    Method.update(arrayList,sc);
                }
                case 0 ->{
                    System.exit(0);
                }
            }
        } while (true);
    }
}
